﻿package mortal.game.net.command.mount
{
    import Framework.MQ.*;
    import Message.Game.*;
    import com.gengine.debug.*;
    import mortal.game.cache.*;
    import mortal.game.manager.*;
    import mortal.game.net.broadCast.*;
    import mortal.game.view.common.cd.*;

    public class MountCardInfoCommand extends BroadCastCall
    {

        public function MountCardInfoCommand(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function call(param1:MessageBlock) : void
        {
            var _loc_4:CDData = null;
            Log.debug("I have receive MountCardInfoCommand");
            var _loc_2:* = param1.messageBase as SMountCardUpdate;
            _cache.mount.updateMountCards(_loc_2.mountCards);
            _cache.mount.updateManureCards(_loc_2.manureCards);
            _cache.mount.currentAmount = _loc_2.times;
            _cache.mount.lastTime = _loc_2.lastResetDt;
            var _loc_3:* = ClockManager.instance.nowDate.time - _loc_2.lastResetDt.time;
            if (_loc_3 != 0 && _loc_3 < 3600000)
            {
                _loc_4 = Cache.instance.cd.registerCDData(CDDataType.backPackLock, "MountCardCD", _loc_4) as CDData;
                _loc_4.totalTime = 3600000 - _loc_3;
                _loc_4.startCoolDown();
            }
            return;
        }// end function

    }
}
